package com.mini.spring.beanfactory.ac;

import java.util.HashMap;
import java.util.Scanner;

/**
 * @author: 屠一乐
 * @date: 2023/8/24 17:30
 * @description:
 */
public class Main5081 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s="";
            for (int j = 0; j <8;j++) {
                s+=scanner.next();
            }
            map.put(s,map.getOrDefault(s,0)+1);
            System.out.println(map.get(s));
        }
    }
}
